/*
 *  comm.h
 *  
 *
 *  Created by Gregory Koch on 27/05/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef COMM_H
#define COMM_H

#include <libgps/gps.h>
#include <libCV/libCV.h>
#include "udp.h"


typedef struct img_receiver_s
{
    udp_server_t serv;
    image_t imgs[2];
    int last_recv;
    int cur;
    int nb_line_next;
} img_receiver_t;

img_receiver_t open_img_receiver(int port, cvSize_t size, int img_type);

void close_img_receiver(img_receiver_t recv);

int send_img(image_t img, unsigned int id, udp_server_t* serv, char* ip, int port);

int recv_img(img_receiver_t *receiver);

int send_gps_gga(gga_t *gga, udp_server_t* serv, char* ip, int port);

int recv_gps_gga(gga_t *gga, udp_server_t* serv);

#endif